#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
int main()
{
	int i,j;
	int x=5;
	int y=10;
	int velocity_x=1;
	int velocity_y=1;
	int top=1;
	int bottom=10;
	int right=20;
	int left=1;

while(1)
{
	if(x>bottom||x<top)
	{  velocity_x=-1*velocity_x;printf("\a");}
	if(y>right||y<left)
	{  velocity_y=-1*velocity_y;printf("\a");}


    x=x+velocity_x;
	y=y+velocity_y;

    system("cls");
	for(i=1;i<=bottom;i++)
	{  
		for(j=1; j <=right; j ++)
		{
			if (i == x && j == y){
				printf ("o");
			}
			else if (i == bottom){
				printf ("_");
			}
			else if (j == right){
				printf ("|");
			}
			else
				printf (" ");
		}
		printf("\n");
	}
	

	Sleep(50);
}

	return 0;
}
